﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PrototypeZGame
{
    public struct Vec2
    {
        public int x, y;

        public Vec2(int i)
        {
            x = i;
            y = i;            
        }

        public Vec2(int x, int y)
        {
            this.x = x;
            this.y = y;            
        }

        public Vec2(Vec2 v)
        {
            x = v.x;
            y = v.y;
        }

        public override string ToString()
        {
            return x + ";" + y;
        }

        public static Vec2 operator +(Vec2 v1, Vec2 v2)
        {
            return new Vec2(v1.x + v2.x, v1.y + v2.y);
        }

        public static Vec2 operator -(Vec2 v1, Vec2 v2)
        {
            return new Vec2(v1.x - v2.x, v1.y - v2.y);
        }

        public static bool operator ==(Vec2 v1, Vec2 v2)
        {
            return v1.x == v2.x && v1.y == v2.y;
        }

        public static bool operator !=(Vec2 v1, Vec2 v2)
        {
            return v1.x != v2.x || v1.y != v2.y;
        }
    }
}
